#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Measure.h>
#include <Length.h>
#include <Volume.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Length)
{
        TEST(lengthInInch plus lengthInInch compare with lengthInFoot )
        {
                Length lengthInInch_1(13, inch);
                Length lengthInInch_2(11, inch);
                Length lengthInFoot(2, feet);

                ASSERT_TRUE( lengthInFoot == (lengthInInch_1+lengthInInch_2) );
        }

        TEST(lengthInInch plus lengthInInch compare with lengthInFoot )
        {
                Length lengthInYard_1(2, yard);
                Length lengthInYard_2(3, yard);
                Length lengthInFoot(3, feet);

                ASSERT_TRUE( lengthInYard_2 == (lengthInFoot + lengthInYard_1) );
        }

	TEST(Compare lengthInMile and lengthInYard )
        {
		Length lengthInMile(2, mile);
		Length lengthInYard(3520, yard);
                ASSERT_TRUE(lengthInMile == lengthInYard);
        }

       TEST(Compare lengthInYard and lengthInFoot)
        {
                Length lengthInYard(2, yard);
                Length lengthInFoot(6, feet);
                ASSERT_TRUE(lengthInYard == lengthInFoot);
        }

       TEST(Compare lengthInFeet and lengthInInch)
        {
                Length lengthInFoot(2, feet);
                Length lengthInInch(24, inch);
                ASSERT_TRUE(lengthInFoot== lengthInInch);
        }

        TEST(Compare lengthInYard and lengthInInch)
        {
                Length lengthInYard(2, yard);
                Length lengthInInch(72, inch);
                ASSERT_TRUE(lengthInYard == lengthInInch);
        }

       TEST(Compare lengthInMile and lengthInInch)
        {
                Length lengthInMile(2, mile);
                Length lengthInInch(126720, inch);
                ASSERT_TRUE(lengthInMile == lengthInInch);
        }

	TEST(Format print)
	{
    	   Length length1(35, inch);
    	   length1.print();
    	   length1.formatPrint();

    	   Length length2(38, inch);
    	   length2.print();
    	   length2.formatPrint();

    	   Length length3(48, inch);
    	   length3.print();
    	   length3.formatPrint();

    	   Length length4(5, feet);
    	   length4.print();
    	   length4.formatPrint();

    	   Length length5(1781, yard);
    	   length5.print();
    	   length5.formatPrint();
	}

	TEST(print length based inch)
	{
           Length length1(35, inch);
           length1.print();
           length1.print(inch);

           Length length2(38, inch);
           length2.print();
           length2.print(inch);

           Length length3(48, inch);
           length3.print();
           length3.print(inch);

           Length length4(5, feet);
           length4.print();
           length4.print(inch);

           Length length5(1781, yard);
           length5.print();
           length5.print(inch);
	}
};
